<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />   
    <title><%= site.title %>: Admin <%= controller.controller_name %></title>
    <%= stylesheet_link_tag 'mephisto/mephisto' %>
    <%= javascript_include_tag 'mephisto/prototype', 'mephisto/effects', 'mephisto/dragdrop', 'mephisto/lowpro', 'mephisto/application' %>
    <script type="text/javascript">Mephisto.root = '<%= ActionController::AbstractRequest.relative_url_root %>';</script>
    <%= yield :head %>
  </head>
  <body>
  
    <!-- div.header -->
    <div id="header">
      <ul id="sec-nav">
        <li><strong><%= link_to _('Website'), dispatch_path([]) %></strong></li>
      <% if admin? -%>
        <li><%= link_to _('Settings'), :controller => 'settings' %></li>
      <% end -%>
        <li><%= link_to _('Account'), :controller => 'users', :action => 'show', :id => current_user %></li>
        <li><%= link_to _('Logout'), :controller => '/account', :action => 'logout' %></li>
      </ul>

      <h1><%= link_to "#{site.title} &mdash; Admin", { :controller => '/admin/overview' }, :title => "#{site.title} admin" %></h1>

      <!-- div.nav -->  
      <div id="nav">
        <% if logged_in? -%>
          <ul>
            <li><%= link_to _('Overview'),  :controller => '/admin/overview' %></li>
            <li><%= link_to _('Articles'),  :controller => '/admin/articles' %></li>
            <li><%= link_to _('Assets'),    :controller => '/admin/assets' %></li>
          </ul>
          <% if admin? -%>
          <ul id="nav-r">
            <li><%= link_to _('Sections'), :controller => '/admin/sections' %></li>
            <li><%= link_to _('Design'),   :controller => '/admin/design' %></li>
            <li><%= link_to _("Users"),    :controller => "users" %></li>
          </ul>
          <% end -%>
        <% end -%>
      </div> 
      <!-- /div.nav -->  
      
      <!-- TODO: Figure out where to put this
      <div id="search">
          <form action="#">
            <input type="text" name="q" />
            <select name="context">
              <%= options_for_select %w(Comments Articles) %>
            </select>
          </form>
        </div>
      -->
      
    </div>
    <!-- /div.header -->
    

    <div id="container">    
      <%= yield :form if @content_for_form %>
      <!-- div.content -->
      <div id="content">
        
        <!-- div.left -->
        <div id="main">
          <div id="flashes">
            <div id="flash-errors" style="display: none;"><%= flash[:error] %></div>
            <div id="flash-notice" style="display:none"><%= flash[:notice] %></div>
          </div>
          <!-- begin action nav -->
          <%= yield :action_nav %>
          <!-- /end action nav -->
          <div id="main-content"><%= yield %></div>
          <div id="shadow"></div>
        </div>
        <!-- /div.left -->
        
        <!-- div.right -->
        <div id="sbar">
          <%= yield :sidebar %>
        </div>
        <!-- /div.right -->
      </div>
      <!-- /div.content -->
      <%= '</form>' if @content_for_form %>
      
      <!-- begin div.footer -->
      <div id="footer">

      </div>
    </div>
  </body>
</html>